#include <iostream>
using std::cout;
using std::endl;
/*
    14、Create a class A with an inline default constructor that announces itself.
    Now make a new class B and put an object of A as a member of B,
    and give B an inline constructor. Create an array of B objects and see what happens.
 */
class A
{
public:
    inline A()
    {
        cout << "the inline default constructor of A is called." << endl;
    }
};

class B
{
public:
    A a;
    inline B()
    {
        cout << "the inline default constructor of B is called." << endl;
    }

    inline B(A a):a(a)
    {
        cout << "the inline constructor with parameters of B is called." << endl;
    }
};

int main()
{
    B arr[5];
    return 0;
}
/*
result:
the inline default constructor of A is called.
the inline default constructor of B is called.
the inline default constructor of A is called.
the inline default constructor of B is called.
the inline default constructor of A is called.
the inline default constructor of B is called.
the inline default constructor of A is called.
the inline default constructor of B is called.
the inline default constructor of A is called.
the inline default constructor of B is called.
*/
